home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "shared.fx"
- #include "lighting.fx"
- #define FOG_DISABLE // c'est mieux parce que sinon le gui il est fogguΘ et c'est pas terrible...
- #include "fog.fx"
-
-
- //------------------------------------------------------------------------------------------------------
- //- Static parameters
- //------------------------------------------------------------------------------------------------------
-
- texture DiffuseMap;
- float4 Color;
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderInput
- {
- float4 Position : POSITION;
- float2 DiffuseUv : TEXCOORD0;
- };
-
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderOutput
- {
- float4 Position : POSITION;
- float2 DiffuseUv : TEXCOORD0;
- FOG_OPTION_VERTEX_FIELD
- };
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- CVertexShaderOutput OpaSelfIllumGeomTech1Pass1 (const CVertexShaderInput input);
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- CVertexShaderOutput OpaSelfIllumGeomTech1Pass1 (const CVertexShaderInput input)
- {
- CVertexShaderOutput output;
-
- // output position into world+view+projection space
- output.Position = mul (input.Position,WorldCameraProjection);
-
- // Diffuse Uv output
- output.DiffuseUv = input.DiffuseUv;
-
- // fog computation
- FOG_OPTION_COMPUTE(output, output.Position);
-
- return output;
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #define RenderStates \
- Texture[0] = <DiffuseMap>; \
- MinFilter[0] = LINEAR; \
- MagFilter[0] = LINEAR; \
- MipFilter[0] = LINEAR; \
- AddressU[0] = WRAP; \
- AddressV[0] = WRAP; \
- CullMode = CW; \
- ZEnable = true; \
- ZFunc = LESSEQUAL; \
- ZWriteEnable = true; \
- AlphaBlendEnable = false; \
- AlphaTestEnable = true; \
- AlphaRef = 192; \
- AlphaFunc = GREATEREQUAL ; \
- FOG_OPTION_PARAMETERS
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- technique tech1
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- RenderStates;
-
- VertexShader = compile vs_1_1 OpaSelfIllumGeomTech1Pass1();
-
- PixelShaderConstant[0] = <Color>;
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul r0,t0,c0
- };
- }
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- technique techTnL_0
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = TNL_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- WorldTransform[0] = <WorldCameraProjection>;
-
- Texture[0] = <DiffuseMap>;
-
- ColorArg1[0] = TEXTURE;
- ColorOp[0] = SELECTARG1;
- AlphaArg1[0] = TEXTURE;
- AlphaOp[0] = SELECTARG1;
-
- ColorOp[1] = DISABLE;
- AlphaOp[1] = DISABLE;
-
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
-
- AddressU[0] = WRAP;
- AddressV[0] = WRAP;
-
- CullMode = CW;
- ZEnable = true;
- ZFunc = LESSEQUAL;
- ZWriteEnable = true;
- AlphaBlendEnable = false;
- AlphaTestEnable = true;
- AlphaRef = 192;
- AlphaFunc = GREATEREQUAL;
-
- VertexShader = NULL;
- PixelShader = NULL;
- }
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "mesh_shadow.fx"
- #include "mesh_shadow_projector.fx"
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------